//
// Created by Administrator on 2018/11/24.
//

#include "vm.h"
#include <utils.h>

void initVm(VM *vm) {
    vm->allocatedBytes = 0;
    vm->curParser = NULL;
    vm->allObjects = NULL;
}

VM *newVM() {
    VM *vm = (VM *) malloc(sizeof(VM));
    if (vm == NULL) {
        MEM_ERROR("allocate VM failed");
    }
    initVm(vm);
    return vm;

}
